---
title: 'Lifecycle events'
sidebarTitle: 'Lifecycle events'
description: 'Hook into specific lifecycle events'
---

Lifecycle events let you customize Nango's behavior at different points in a [Connection](/guides/use-cases/api-auth#what-is-a-connection%3F)'s lifecycle.

## How lifecycle events work

Lifecycle events are triggered by the Nango platform when certain things happen for a [Connection](/guides/use-cases/api-auth#what-is-a-connection%3F).

You can customize Nango's behavior by registering an event handler [Function](/guides/platform/functions) for an event and specific integration.

For example: You register a `post-connection-creation` event handler function on your Salesforce integration. Nango will call this function once for each Salesforce connection, immediately after it has been created.

All lifecycle event executions are logged in Nango's [logs](/guides/platform/logs).

To implement a lifecycle event handler, follow our [implementation guide](/implementation-guides/platform/implement-event-handler).

## Supported lifecycle events

Nango currently supports the following events:
- `validate-connection` occurs when a connection is being created and allows for custom validation of the connection credentials. This will reject and delete the connection if it fails the validation.
- `post-connection-creation` occurs when a connection has been created.
- `pre-connection-deletion` occurs before a connection is deleted.

Check out the [lifecycle events reference](/reference/integration-configuration#on-events-fields) for details.

## Common use cases for lifecycle events

- Integration-specific validation logic for API keys or other credentials (e.g., check permissions to access a specific endpoint)
- Register webhook subscriptions after a connection has been created
- Fetch account configuration information from the external API
- Deregister webhook subscriptions when a connection is deleted
- Revoke an access token on the external API when a connection is deleted